/*
 * @Author: 曹曙光
 * @Date: 2023-05-07 11:43:49
 * @LastEditors: 曹曙光
 * @LastEditTime: 2023-05-08 11:30:22
 * @FilePath: \node项目启动文件测试\db\db.js
 * @Description: 
 * 
 */
const mysql = require('mysql')
// -关联的表
const database = 'myblog'
// -关联的地址
const host = '165.154.71.63'
// -关联的用户和密码
const user = 'shuguang'
const password_sql = 'cw141313'
const port_sql = '3006'
var connction = mysql.createConnection({
    // -本地数据库
    // host: host,
    // user: user,
    // password: password_sql,
    // port: port_sql,
    // database: database


    host: '165.154.71.63',
    user: 'shuguang',
    password: 'cw141313',
    port: 3306,
    database: 'Accounting'
})
connction.connect((err, result) => {
    if (err) console.log(err);
    console.log(result);
})
// let sql1 = `select * from user`
// connction.query(sql1, (err, result) => {
//     if (err) {
//         console.log('err--sql语句出错-->', err);
//     }
//     console.log('result--sql语句成功-->', result);
  
// })

module.exports = {
    connction,
}
